{layout name="admin/layout" /}

<div class="col-xs-12">
    <div class="page-header">
        <h1>{:v('headtitle')}</h1>
    </div>
    {if condition="has_menu($menu,'Product/add')"}
    <button class="btn btn-success store" data-url="{:url('add')}" style="margin-bottom: 15px">新增产品</button>
    {/if}
    <div class="table-responsive">
        <table id="sample-table-1" class="table table-striped table-bordered table-hover">
            <thead>
            <tr>
                <th class="center">
                    <label>
                        <input type="checkbox" class="ace"/>
                        <span class="lbl"></span>
                    </label>
                </th>
                <th>id</th>
                <th>名称</th>
                <th>编号</th>
                <th>价格</th>
                <th>产品类型</th>
                <th>规格</th>
                <th>添加时间</th>
                <th>更新时间</th>
                <th>操作</th>
            </tr>
            </thead>

            <tbody>
            {volist name='list' id='v'}
            <tr>
                <td class="center">
                    <label>
                        <input type="checkbox" class="ace"/>
                        <span class="lbl"></span>
                    </label>
                </td>
                <td>{$v.id}</td>
                <td>{$v.p_name}</td>
                <td>{$v.p_number}</td>
                <td>{$v.p_price}</td>
                <td>{eq name='v.p_type' value='1'}免费领取{else /}套装{/eq}</td>
                <td>
                    {volist name='v.spec' id='vv'}
                        {$vv.s_name}、
                    {/volist}
                </td>
                <td>{$v.create_time}</td>
                <td>{$v.update_time}</td>
                <td>
                    <div class="visible-md visible-lg hidden-sm hidden-xs btn-group">
                        {if condition="has_menu($menu,'Product/edit')"}
                        <button class="btn btn-xs btn-info store" data-url="{:url('edit',array('id'=>$v['id']))}">
                            <i class="icon-edit bigger-120"></i>
                        </button>
                        {/if}
                        {if condition="has_menu($menu,'Product/delete')"}
                        <button class="btn btn-xs btn-danger ajax" data-url="{:url('delete',array('id'=>$v['id']))}">
                            <i class="icon-trash bigger-120"></i>
                        </button>
                        {/if}
                    </div>
                </td>
            </tr>
            {/volist}
            </tbody>
        </table>
    </div><!-- /.table-responsive -->
</div><!-- /span -->